package com.quectel.core.module.scheduling.entity.mongo;

import com.quectel.core.constants.MongoCollectionConstants;
import com.quectel.core.module.dept.entity.DeptEntity;
import com.quectel.core.module.dept.entity.DeptPersonEntity;
import com.quectel.core.module.scheduling.entity.SchedulingAttendanceGroupEntity;
import com.quectel.core.module.scheduling.entity.SchedulingTimeConfigEntity;
import com.quectel.util.client.mongo.MongoBaseModel;
import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;

import java.util.Date;
import java.util.List;

/**
 * 原始打卡记录表
 *
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2021-11-22 11:47:45
 */
@Data
@Document(MongoCollectionConstants.ATTENDANCE_ORIGINAL_CHECK_RECORD)
@CompoundIndex(name = "idx_person_checkTime", def = "{'personId': 1,'checkTime': 1}", background = true)
@CompoundIndex(name = "idx_daily", def = "{'dailyId': 1}", background = true)
public class MongoOriginalCheckRecordModel implements MongoBaseModel {

    /**
     * id
     */
    @MongoId
    private Long id;

    /**
     * 租户id
     */
    private Long tenantId;

    /**
     * 小区id
     */
    private Long villageId;

    /**
     * 员工 id
     */
    private Long personId;

    /**
     * 考勤组 id
     */
    private Long attendanceGroupId;

    /**
     * 考勤记录 id
     */
    private Long dailyId;

    /**
     * 打卡位置经度
     */
    private Double longitude;

    /**
     * 打卡地址纬度
     */
    private Double latitude;

    /**
     * 打卡地址
     */
    private String address;

    /**
     * 是否补卡
     */
    private Byte isRepair;

    /**
     * 是否外勤
     */
    private byte isField;

    /**
     * 外勤打卡图片集合
     */
    private String[] pics;

    /**
     * 外勤打卡备注
     */
    private String remark;

    /**
     * 打卡时间
     */
    private Date checkTime;

    /**
     * 员工信息
     */
    private DeptPersonEntity deptPerson;

    /**
     * 部门信息
     */
    private DeptEntity dept;

    /**
     * 考勤组信息
     */
    private SchedulingAttendanceGroupEntity schedulingAttendanceGroup;

    /**
     * 当天排班时间段
     */
    private List<SchedulingTimeConfigEntity> times;
}
